package com.franklin.ideaplugin.maphelper.col.operation.impl.collection.list;

import com.franklin.ideaplugin.maphelper.col.method.IColInsertMethod;
import com.franklin.ideaplugin.maphelper.col.method.IColQueryMethod;
import com.franklin.ideaplugin.maphelper.col.method.impl.ColInsertMethodImpl;
import com.franklin.ideaplugin.maphelper.col.method.impl.DefaultColQueryMethod;

import java.util.Set;

/**
 * @author Ye Junhui
 * @since 2024/3/20
 */
public class FastJson1JsonArrayReadWriteOperation extends ListReadWriteOperation {

    @Override
    public String getClassQualifiedName() {
        return "com.alibaba.fastjson.JSONArray";
    }

    @Override
    public Set<IColInsertMethod> getInsertMethods() {
        Set<IColInsertMethod> insertMethods = super.getInsertMethods();
        insertMethods.add(new ColInsertMethodImpl("fluentAdd",1,0));
        insertMethods.add(new ColInsertMethodImpl("fluentAdd",2,1));
        return insertMethods;
    }

    @Override
    public Set<IColQueryMethod> getQueryMethods() {
        Set<IColQueryMethod> queryMethods = super.getQueryMethods();
        queryMethods.add(new DefaultColQueryMethod("getJSONObject",1,0));
        queryMethods.add(new DefaultColQueryMethod("getJSONArray",1,0));
        return queryMethods;
    }

    @Override
    public Set<IColInsertMethod> getInsertAllMethods() {
        Set<IColInsertMethod> insertAllMethods = super.getInsertAllMethods();
        insertAllMethods.add(new ColInsertMethodImpl("fluentAddAll",1,0));
        insertAllMethods.add(new ColInsertMethodImpl("fluentAddAll",2,1));
        return insertAllMethods;
    }
}
